package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 评论类别
 */
public enum Enum_CommentType {



    Leader("B01-198A01", "领队"),
    Car("B01-198A02", "车辆"),
    Driver("B01-198A03", "司机"),
    Scenic("B01-198A04", "景点"),
    TourMainTravel("B01-198A05", "行程"),
    Other("B01-198A06", "其他"),
    TripNote("B01-198A07", "游记");

    private String s;
    private String title;

    Enum_CommentType(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_CommentType(String s) {
        this.s = s;
        this.title = Enum_CommentType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_CommentType parseCode(String code) {
        switch (code) {
            case "B01-198A01":
                return Leader;
            case "B01-198A02":
                return Car;
            case "B01-198A03":
                return Driver;
            case "B01-198A04":
                return Scenic;
            case "B01-198A05":
                return TourMainTravel;
            case "B01-198A06":
                return Other;
            case "B01-198A07":
                return TripNote;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }
}
